<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta name="keywords" content="hexo, autumn" />
    <title>
        iOS开发
    </title>
    <!-- favicon -->
    
    <link rel="icon" href="https://cdn.jsdelivr.net/gh/frontendsophie/hexo-theme-autumn@1.0.0/source/img/favicon.ico" />
     <link rel="stylesheet" href="/blog/css/style.css">

    <!-- highlight -->
    <link rel="stylesheet" href="https://cdn.bootcss.com/highlight.js/9.12.0/styles/github-gist.min.css" />
    <script src="//cdn.bootcss.com/highlight.js/9.2.0/highlight.min.js"></script>
    <script>
        hljs.initHighlightingOnLoad()
    </script>
    <script src="https://cdn.jsdelivr.net/gh/frontendsophie/hexo-infinite-scroll@2.0.0/dist/main.js"></script>

    <script>
        infiniteScroll()

        window.addEventListener('DOMContentLoaded', function () {
            const [
                mainTitle,
                mobileMenu,
                mobileMainTitle,
                mobileMenuBtn,
                ipadMenuBtn,
                aside,
                closeBtn,
            ] = getEle(
                '#main-title',
                '.mobile-menu',
                '.mobile-menu h3',
                '.mobile-menu button',
                '.ipad-menu',
                'aside',
                'aside .close',
            )
            const io = new IntersectionObserver(entries => {
                if (entries[0].intersectionRatio <= 0) {
                    mobileMainTitle.classList.remove('invisibile')
                } else {
                    mobileMainTitle.classList.add('invisibile')
                }
            })
            io.observe(mainTitle)

            clickToggleAside(mobileMenuBtn)
            clickToggleAside(ipadMenuBtn)
            clickToggleAside(closeBtn, false)

            const isMenuVisible = window.getComputedStyle(mobileMenu).display !== 'none'
            if (isMenuVisible) document.body.style.background = 'none'

            function getEle(...args) {
                return args.map(arg => document.querySelector(arg))
            }

            function clickToggleAside(btn, show = true) {
                btn.addEventListener('click', function () {
                    if (show) {
                        aside.style.display = 'block'
                    } else {
                        aside.style.display = 'none'
                    }
                })
            }
        })
    </script>
</head>

<body style="background: url(https://cdn.jsdelivr.net/gh/frontendsophie/hexo-theme-autumn@1.0.0/source/img/button-bg.png) #f3f3f3">
    <div class="container">
        <header class="header">
    <nav class="mobile-menu" style="background: url(https://cdn.jsdelivr.net/gh/frontendsophie/hexo-theme-autumn@1.0.0/source/img/button-bg.png) #f3f3f3">
        <h3 class="invisibile">
            <a href="/blog/" class="logo">
                iOS开发
            </a>
        </h3>
        <button class="menu">menu</button>
    </nav>

    <button class="ipad-menu menu">menu</button>

    <h1 class="title" id="main-title">
        <a href="/blog/" class="logo">
            iOS开发
        </a>
    </h1>
    <h2 class="desc">
        
    </h2>

    <div class="links">
        <ul>
            
            <li>
                <a href="https://github.com/FrontendSophie" target="_blank" rel="noopener">
                    Github
                </a>
            </li>
            
            <li>
                <a href="https://www.linkedin.com/in/frontendsophie/" target="_blank" rel="noopener">
                    LinkedIn
                </a>
            </li>
            
        </ul>
    </div>
</header>
        <main class="main">
            <article class="post">
    
    
    
    <h2 class="post-title">
        CocoaPods 的安装流程
    </h2>
    <ul class="post-date">
        <li>
            2020-02-28
        </li>
        <li>
            selinaSun
        </li>
    </ul>
    <div class="post-content">
        <h2 id="iOS-最新版-CocoaPods-的安装流程，正好要装-，留档记录一下"><a href="#iOS-最新版-CocoaPods-的安装流程，正好要装-，留档记录一下" class="headerlink" title="iOS 最新版 CocoaPods 的安装流程，正好要装 ，留档记录一下"></a>iOS 最新版 CocoaPods 的安装流程，正好要装 ，留档记录一下</h2><h3 id="参见CocoaPods官网"><a href="#参见CocoaPods官网" class="headerlink" title="参见CocoaPods官网"></a>参见CocoaPods官网</h3><h3 id="1-移除现有Ruby默认源"><a href="#1-移除现有Ruby默认源" class="headerlink" title="1.移除现有Ruby默认源"></a>1.移除现有Ruby默认源</h3><p><code>$gem sources --remove https://rubygems.org/</code></p>
<h3 id="2-使用新的源"><a href="#2-使用新的源" class="headerlink" title="2.使用新的源"></a>2.使用新的源</h3><p><code>$gem sources -a https://gems.ruby-china.com</code></p>
<h3 id="3-验证新源是否替换成功"><a href="#3-验证新源是否替换成功" class="headerlink" title="3.验证新源是否替换成功"></a>3.验证新源是否替换成功</h3><p><code>$gem sources -l</code></p>
<h3 id="4-安装CocoaPods"><a href="#4-安装CocoaPods" class="headerlink" title="4.安装CocoaPods"></a>4.安装CocoaPods</h3><h3 id="1-sudo-gem-install-cocoapods备注：苹果系统升级OS-X-EL-Capitan后改为-sudo-gem-install-n-usr-local-bin-cocoapods"><a href="#1-sudo-gem-install-cocoapods备注：苹果系统升级OS-X-EL-Capitan后改为-sudo-gem-install-n-usr-local-bin-cocoapods" class="headerlink" title="(1)$sudo gem install cocoapods备注：苹果系统升级OS X EL Capitan后改为$sudo gem install -n /usr/local/bin cocoapods"></a>(1)$sudo gem install cocoapods备注：苹果系统升级OS X EL Capitan后改为$sudo gem install -n /usr/local/bin cocoapods</h3><h3 id="更换第三方框架仓库源"><a href="#更换第三方框架仓库源" class="headerlink" title="更换第三方框架仓库源"></a>更换第三方框架仓库源</h3><p><code>pod repo remove master</code><br><code>pod repo add master http://git.oschina.net/akuandev/Specs.git</code></p>
<p><code>若失效则替换为 https://gitcafe.com/akuandev/Specs.git</code></p>
<h3 id="2-pod-setup"><a href="#2-pod-setup" class="headerlink" title="(2)$pod setup"></a>(2)$pod setup</h3><h3 id="5-更新gem"><a href="#5-更新gem" class="headerlink" title="5.更新gem"></a>5.更新gem</h3><p><code>$sudo gem update --system</code></p>
<h3 id="6-新建工程，并在终端用cd指令到文件夹内"><a href="#6-新建工程，并在终端用cd指令到文件夹内" class="headerlink" title="6.新建工程，并在终端用cd指令到文件夹内"></a>6.新建工程，并在终端用cd指令到文件夹内</h3><p><code>$pod search 第三方</code></p>
<h3 id="7-新建文件-vim-“Podfile”"><a href="#7-新建文件-vim-“Podfile”" class="headerlink" title="7.新建文件 vim “Podfile”"></a>7.新建文件 vim “Podfile”</h3><p><code>$vim Podfile</code></p>
<p><code>写入以下内容并保存 小提示：（终端vim文件 按 i 可编辑 ，esc 退出编辑，：wq  可保存退出）</code></p>
<p><code>platform:ios, &#39;6.0&#39;</code></p>
<p><code>pod &#39;AFNetworking&#39;, &#39;~&gt; 2.3.1&#39;&lt;-------第三方</code></p>
<h3 id="8-导入第三方库"><a href="#8-导入第三方库" class="headerlink" title="8.导入第三方库"></a>8.导入第三方库</h3><p><code>$pod install</code></p>
<p><code>错误3：</code></p>
<p><code>[!] Unable to satisfy the following requirements:-</code>AVOSCloud (~&gt; 3.1.6.3)<code>required by</code>Podfile<code></code></p>
<p><code>Specs satisfying the</code>AVOSCloud (~&gt; 3.1.6.3)<code>dependency were found, but they required a higher minimum deployment target.</code></p>
<p><code>解决方案：安装流程：Podfile文件中   platform:ios, ‘6.0’  后边的 6.0 是平台版本号 ，一定要加上</code></p>

    </div>
</article>
        </main>
        <aside class="aside">
            <div class="close"></div>
            <section class="aside-section">
                
    <h1>Categories</h1>

    

            </section>
            <section class="aside-section">
                
    <h1>Archives</h1>

    <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2020/">2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2019/">2019</a></li></ul>


            </section>
            <section class="aside-section tag">
                
    <h1>Tags</h1>

    

            </section>
        </aside>
    </div>
</body>

</html>